Skip to content

πŸ›Fix: μ—¬λŸ¬κ°€μ§€ μˆ˜μ •#116

Merged
dkslel1225 merged 2 commits intodevelopfrom
feature/dashboard_id
Jun 22, 2025
Merged

πŸ›Fix: μ—¬λŸ¬κ°€μ§€ μˆ˜μ •#116
dkslel1225 merged 2 commits intodevelopfrom
feature/dashboard_id

Conversation

@dkslel1225
Copy link
Copy Markdown
Contributor

@dkslel1225 dkslel1225 commented Jun 22, 2025

πŸ“Œ λ³€κ²½ 사항 κ°œμš”

  • z-indexμΆ”κ°€
  • 낙관적 μ—…λ°μ΄νŠΈμ— - totalcount도 μ—…λ°μ΄νŠΈ μΆ”κ°€
  • λͺ¨λ‹¬ λ°±κ·ΈλΌμš΄λ“œ 클릭 λ§‰μŒ

πŸ’‘ μ°Έκ³  사항

Summary by CodeRabbit

  • 버그 μˆ˜μ •

    • μΉ΄λ“œ 생성 λͺ¨λ‹¬μ—μ„œ λ°°κ²½ 클릭 μ‹œ 이벀트 μ „νŒŒκ°€ μ°¨λ‹¨λ˜μ–΄, μ˜λ„μΉ˜ μ•Šμ€ λ™μž‘μ΄ λ°œμƒν•˜μ§€ μ•Šλ„λ‘ κ°œμ„ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
    • μΉ΄λ“œ 이동 μ‹œ μ»¬λŸΌλ³„ μΉ΄λ“œ 개수(totalCount)κ°€ μ˜¬λ°”λ₯΄κ²Œ κ°±μ‹ λ˜μ–΄, μΉ΄λ“œ μˆ˜κ°€ μ •ν™•ν•˜κ²Œ ν‘œμ‹œλ©λ‹ˆλ‹€.
  • 정리

    • ν…ŒμŠ€νŠΈμš© νŽ˜μ΄μ§€κ°€ μ‚­μ œλ˜μ–΄, μ‹€μ œ μ„œλΉ„μŠ€ μ΄μš©μ— λΆˆν•„μš”ν•œ 화면이 μ œκ±°λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 22, 2025

Walkthrough

이번 λ³€κ²½μ—μ„œλŠ” μΉ΄λ“œ 이동 μ‹œ optimistic update의 totalCount 일관성 κ°œμ„ , λͺ¨λ‹¬ μ˜€λ²„λ ˆμ΄ 클릭 이벀트 μ „νŒŒ λ°©μ§€, 주석 제거, 그리고 ν…ŒμŠ€νŠΈμš© νŽ˜μ΄μ§€ 파일 μ‚­μ œκ°€ μ΄λ£¨μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€. μ „μ²΄μ μœΌλ‘œ UI와 μΊμ‹œ μƒνƒœ 동기화 κ΄€λ ¨ μ½”λ“œκ°€ μ •λˆλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Changes

파일/경둜 λ³€κ²½ μš”μ•½
src/app/features/dashboard_Id/Card/cardFormModals/CreateCardModal.tsx λͺ¨λ‹¬ μ»¨ν…Œμ΄λ„ˆμ— onClick 이벀트 ν•Έλ“€λŸ¬ μΆ”κ°€(e.stopPropagation)
src/app/features/dashboard_Id/Column/Column.tsx μΉ΄λ“œ 생성 λ²„νŠΌ λ‚΄ λΆˆν•„μš”ν•œ 주석(div) 제거
src/app/features/dashboard_Id/api/useCardMutation.ts optimistic update μ‹œ totalCount 증감 둜직 μΆ”κ°€ 및 주석 λͺ…ν™•ν™”
src/app/tester/page.tsx ν…ŒμŠ€νŠΈμš© νŽ˜μ΄μ§€ μ»΄ν¬λ„ŒνŠΈ 파일 μ‚­μ œ

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ModalOverlay
    participant ModalContent

    User->>ModalOverlay: Click overlay
    ModalOverlay->>ModalOverlay: onClick (e.stopPropagation)
    ModalOverlay--x ModalContent: 이벀트 μ „νŒŒ 차단
Loading
sequenceDiagram
    participant User
    participant Column
    participant useCardMutation
    participant Cache

    User->>Column: μΉ΄λ“œ λ“œλž˜κ·Έ 이동
    Column->>useCardMutation: μΉ΄λ“œ 이동 mutate 호좜
    useCardMutation->>Cache: 이전 μ»¬λŸΌμ—μ„œ μΉ΄λ“œ 제거, totalCount -1
    useCardMutation->>Cache: μƒˆ μ»¬λŸΌμ— μΉ΄λ“œ μΆ”κ°€, totalCount +1
Loading

Possibly related PRs

Suggested labels

πŸ›Fix

Suggested reviewers

  • yuj2n
  • Insung-Jo

Poem

πŸ‡
λͺ¨λ‹¬ μœ„μ— 클릭, 토끼가 λ©ˆμ·„μ£ ,
μΉ΄λ“œκ°€ 이동해도 숫자 λ”± λ§žμΆ°μš”.
ν…ŒμŠ€νŠΈ 방은 쑰용히 사라지고,
주석도 λ§λ”νžˆ μ²­μ†Œλμ–΄μš”.
μ˜€λŠ˜λ„ μ½”λ“œλŠ” κΉ”λ”ν•˜κ²Œ,
ν† λΌλŠ” νλ­‡ν•˜κ²Œ 좀을 μΆ°μš”!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

πŸ”§ ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-22T15_48_59_488Z-debug-0.log

✨ Finishing Touches
  • πŸ“ Generate Docstrings

πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

πŸ”­ Outside diff range comments (1)
src/app/features/dashboard_Id/api/useCardMutation.ts (1)

104-112: λ‘€λ°± 둜직의 νƒ€μž… 뢈일치 문제 μˆ˜μ • ν•„μš”

λ‘€λ°± λ‘œμ§μ—μ„œ νƒ€μž… 뢈일치 λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. 낙관적 μ—…λ°μ΄νŠΈμ—μ„œλŠ” InfiniteData<CardResponse> νƒ€μž…μ„ μ‚¬μš©ν•˜μ§€λ§Œ, λ‘€λ°±μ—μ„œλŠ” CardResponse νƒ€μž…μœΌλ‘œ μ„€μ •ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

-onError: (error, variables, context) => {
-  if (context?.previousData) {
-    queryClient.setQueryData<CardResponse>(
-      ['columnId', variables.columnId],
-      context.previousData,
-    )
-  }
-  console.error('μΉ΄λ“œ 이동 μ‹€νŒ¨:', error)
-},
+onError: (error, variables, context) => {
+  if (context?.previousData) {
+    queryClient.setQueryData<InfiniteData<CardResponse>>(
+      ['columnId', variables.columnId],
+      context.previousData,
+    )
+  }
+  // 이전 μ»¬λŸΌλ„ λ‘€λ°±ν•΄μ•Ό ν•˜λŠ”μ§€ κ³ λ € ν•„μš”
+  const currentCard = useDragStore.getState().draggingCard
+  if (currentCard && context?.previousPrevColumnData) {
+    queryClient.setQueryData<InfiniteData<CardResponse>>(
+      ['columnId', currentCard.cardData.columnId],
+      context.previousPrevColumnData,
+    )
+  }
+  console.error('μΉ΄λ“œ 이동 μ‹€νŒ¨:', error)
+},

λ˜ν•œ 이전 컬럼의 데이터도 λ‘€λ°± μ»¨ν…μŠ€νŠΈμ— μ €μž₯ν•˜κ³  λ³΅μ›ν•˜λŠ” 것을 κ³ λ €ν•΄λ³΄μ„Έμš”.

🧹 Nitpick comments (1)
src/app/features/dashboard_Id/Card/cardFormModals/CreateCardModal.tsx (1)

16-19: λͺ¨λ‹¬ UX κ°œμ„ μ„ μœ„ν•œ μ œμ•ˆ

ν˜„μž¬ λͺ¨λ‹¬ μ˜€λ²„λ ˆμ΄μ—μ„œ 이벀트 μ „νŒŒλ§Œ μ°¨λ‹¨ν•˜κ³  μžˆλŠ”λ°, 일반적으둜 μ‚¬μš©μžλŠ” λͺ¨λ‹¬ 배경을 ν΄λ¦­ν–ˆμ„ λ•Œ λͺ¨λ‹¬μ΄ λ‹«νžˆκΈ°λ₯Ό κΈ°λŒ€ν•©λ‹ˆλ‹€. UX ν–₯상을 μœ„ν•΄ λ‹€μŒκ³Ό 같이 κ°œμ„ ν•˜λŠ” 것을 κ³ λ €ν•΄λ³΄μ„Έμš”:

+interface ModalProps {
+  children: React.ReactNode
+  onClose?: () => void
+}

-export default function CreateCardModal({ children }: ModalProps) {
+export default function CreateCardModal({ children, onClose }: ModalProps) {
   // ...
   return createPortal(
     <div
       className="z-60 fixed inset-0 flex items-center justify-center bg-black/40"
-      onClick={(e) => e.stopPropagation()}
+      onClick={(e) => {
+        e.stopPropagation()
+        onClose?.()
+      }}
     >
-      <div className="BG-white h-970 w-584 overflow-y-scroll rounded-16 p-32 shadow-lg [mask-image:radial-gradient(white_100%,transparent_100%)] mobile:h-766 mobile:w-327 mobile:px-16 mobile:py-24">
+      <div 
+        className="BG-white h-970 w-584 overflow-y-scroll rounded-16 p-32 shadow-lg [mask-image:radial-gradient(white_100%,transparent_100%)] mobile:h-766 mobile:w-327 mobile:px-16 mobile:py-24"
+        onClick={(e) => e.stopPropagation()}
+      >
         {children}
       </div>
     </div>,
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d0e34b7 and f3fc357.

πŸ“’ Files selected for processing (4)
  • src/app/features/dashboard_Id/Card/cardFormModals/CreateCardModal.tsx (1 hunks)
  • src/app/features/dashboard_Id/Column/Column.tsx (0 hunks)
  • src/app/features/dashboard_Id/api/useCardMutation.ts (3 hunks)
  • src/app/tester/page.tsx (0 hunks)
πŸ’€ Files with no reviewable changes (2)
  • src/app/features/dashboard_Id/Column/Column.tsx
  • src/app/tester/page.tsx
πŸ”‡ Additional comments (2)
src/app/features/dashboard_Id/api/useCardMutation.ts (2)

54-54: 주석 κ°œμ„ μ΄ μ’‹μŠ΅λ‹ˆλ‹€

주석이 더 λͺ…ν™•ν•˜κ³  ꡬ체적으둜 λ³€κ²½λ˜μ–΄ μ½”λ“œ 가독성이 ν–₯μƒλ˜μ—ˆμŠ΅λ‹ˆλ‹€.


69-69: totalCount 동기화 κ°œμ„ μ΄ ν›Œλ₯­ν•©λ‹ˆλ‹€

낙관적 μ—…λ°μ΄νŠΈμ—μ„œ totalCountλ₯Ό 적절히 μ¦κ°μ‹œμΌœ μΊμ‹œ 일관성을 μœ μ§€ν•˜λŠ” κ°œμ„ μ‚¬ν•­μ΄ 맀우 μ’‹μŠ΅λ‹ˆλ‹€. μ΄λŠ” λ¬΄ν•œ μŠ€ν¬λ‘€μ΄λ‚˜ νŽ˜μ΄μ§€λ„€μ΄μ…˜μ—μ„œ λ°œμƒν•  수 μžˆλŠ” 데이터 뢈일치 문제λ₯Ό λ°©μ§€ν•©λ‹ˆλ‹€.

Also applies to: 88-88

@dkslel1225 dkslel1225 merged commit 297bfe9 into develop Jun 22, 2025
1 of 2 checks passed
@dkslel1225 dkslel1225 self-assigned this Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant